<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>注册--编程之友BBS</title>
    <link rel="stylesheet" type="text/css" href="style/top.css" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/footer.css" />
    <link rel="stylesheet" type="text/css" href="style/reglog.css" />
    <script type="text/javascript">
    	function checklogin(){
			var name = document.getElementById("username").value;
			var pwd = document.getElementById("userpwd").value;
			var tips = document.getElementById("tips");
			var regex = /^\w+$/;
			if(regex.test(name) && regex.test(pwd)){
				return true;
			} else {
				tips.innerHTML = "必须输入有效地用户名和密码！";
				return false;
			}
    	}
    </script>
  </head>
  
  <body>
    <!-- 网页头部 -->
    <%@include file="template/head.jsp" %>

    <div class="bd">
	<h3>登陆</h3>
    <div class="bd_left2">
    	<form action="user.jspx?_method=login" method="post" onsubmit="return checklogin()">
        用户名　：<input type="text" id="username" name="username" /><br />
        密　码　：<input type="password" id="userpwd" name="userpwd" /><br />
        <h4 id="tips" ></h4>
        <input type="submit" value="登陆" />
        </form>
    </div>
    <div class="bd_right2">
    	<span class="tologin">还没有有账号？去<a href="index.jspx?_method=register">注册</a></span>
    </div>
	<c:if test="${not empty msg}">
		<h3 style="text-align:center;">${msg }</h3>
		<c:remove var="msg" scope="session"/>
	</c:if>
</div>
    
    
      <!-- 网页底部 -->
    <%@include file="template/footer.jsp" %>
  </body>
</html>
    